package com.leo.apptest.activity;

import android.animation.ObjectAnimator;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.animation.DecelerateInterpolator;
import android.widget.ImageView;

import com.leo.apptest.R;

public class AnimActivity extends AppCompatActivity {

    private ImageView mIvBox;
    private ObjectAnimator mTranslationY;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_anim);
        mIvBox = (ImageView) findViewById(R.id.ivBox);
        float y = mIvBox.getTranslationY();
        mTranslationY = ObjectAnimator.ofFloat(mIvBox, "translationY", y, y + 800).setDuration(3000);
        mTranslationY.setInterpolator(new DecelerateInterpolator());
        mTranslationY.start();

        

    }
}
